package com.freecloud.javabasics.javap;

/**
 * 动态链接
 * @Author: maomao
 * @Date: 2019-11-05 09:06
 */
public class DynamicLink {

    static class Super{
        public void test(){
            System.out.println("super");
        }
    }

    static class Sub1 extends Super{

        @Override
        public void test(){
            System.out.println("Sub1");
        }
    }
    static class Sub2 extends Super {
        @Override
        public void test() {
            System.out.println("Sub2");
        }
    }

    public static void main(String[] args) {
        Super super1 = new Sub1();
        Super super2 = new Sub2();

        super1.test();
        super2.test();
    }
}
